<template>
  <div>
   <div class="fill">
    </div>
        <img src="../../assets/logo.png" alt="" class="logo">
    <el-container>
      <el-aside width="200px" class="el-aside">
        <el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
          background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
          <el-menu-item index="2">
            <i class=""></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-submenu index="1">
            <template slot="title">
              <i class=""></i>
              <span>课程管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="1-1">小学课程</el-menu-item>
              <el-menu-item index="1-2">初中课程</el-menu-item>
              <el-menu-item index="1-3">高中课程</el-menu-item>
              <el-menu-item index="1-4">大学课程</el-menu-item>
            </el-menu-item-group>

          </el-submenu>

          <el-menu-item index="3">
            <span slot="title" @click="stuManage">学生管理</span>
          </el-menu-item>
          <el-menu-item index="4">
            <span slot="title" @click="tecManage">教师管理</span>
          </el-menu-item>
        </el-menu>

      </el-aside>


      <el-container>
        <el-header class="el-header">
          <el-menu mode="horizontal" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
            <el-menu-item index="0"  @click="login">首页 </el-menu-item>
            <el-menu-item index="1">课程中心</el-menu-item>
            <el-submenu index="2">
              <template slot="title">审批管理</template>
              <el-menu-item index="2-1">选课申请</el-menu-item>
              <el-menu-item index="2-2">面试申请</el-menu-item>
              <el-menu-item index="2-3">课程申请</el-menu-item>
              <el-submenu index="2-4">
                <template slot="title">选项4</template>
                <el-menu-item index="2-4-1">选项1</el-menu-item>
                <el-menu-item index="2-4-2">选项2</el-menu-item>
                <el-menu-item index="2-4-3">选项3</el-menu-item>
              </el-submenu>
            </el-submenu>
            <!--          <el-menu-item index="3" disabled>消息中心</el-menu-item>-->
            <el-menu-item index="3">消息中心</el-menu-item>
            <div>
              <div class="avatar">
                <el-avatar :size="40" :src="circleUrl" ></el-avatar>
              </div>
            </div>
          </el-menu>
        </el-header>
        <el-main class="el-main">
              <router-view/>
        </el-main>
      </el-container>
    </el-container>

  </div>
</template>
<script>
  export default {
    data() {
      return {
        circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
      }
    },
    methods: {
      stuManage() {
        this.$router.push("/displayStu")
      },
      login(){
        this.$router.push("/login")
      },
      tecManage(){
        this.$router.push("/displayTec")
      }
    }
  }

</script>
<style scoped>
.fill{
  width: 200px;
  height: 100px;
  position: absolute;
  top:8px;
  left:3px;
  background-color: #545c64;
}
.logo{
  position: absolute;
  width: 50px;
  left:85px;
  top:16px;
  z-index:1000;
  }
  .avatar {
    position: absolute;
    right: 30px;
    top: 10px;
  }

  .el-header {
    margin-left: -1px;
    padding: 0px;
    z-index: 100;
    width: 100%;
  }

  .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .el-aside {

    background-color: #545c64;
    color: #333;
    text-align: center;
    line-height: 100px;
    height: auto;
  }

  .el-main {
    padding: 0;
    background-color: #E9EEF3;
    color: white;
    text-align: center;
    line-height: 160px;
    height: 600px;
    overflow-y: auto;
  }

  body>.el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

</style>
